// Product 类
class Product {
    private String partA;
    private String partB;

    public void setPartA(String partA) {
        this.partA = partA;
    }

    public void setPartB(String partB) {
        this.partB = partB;
    }

    public void show() {
        System.out.println("Product Parts -- A: " + partA + ", B: " + partB);
    }
}

// Builder 接口
interface Builder {
    Builder buildPartA(String partA);
    Builder buildPartB(String partB);
    Product getResult();
}

// ConcreteBuilder 类
class ConcreteBuilder implements Builder {
    private Product product = new Product();

    public Builder buildPartA(String partA) {
        product.setPartA(partA);
        return this;
    }

    public Builder buildPartB(String partB) {
        product.setPartB(partB);
        return this;
    }

    public Product getResult() {
        return product;
    }
}

// Director 类
class Director {
    public Product construct(Builder builder) {
        return builder.buildPartA("PartA").buildPartB("PartB").getResult();
    }
}

// 测试类
public class BuilderTest {
    public static void main(String[] args) {
        Director director = new Director();
        Builder builder = new ConcreteBuilder();
        Product product = director.construct(builder);
        product.show();
    }
}